package com.stone.mpandroidchartdemo;

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

/**
 * @author Stone
 * @version V1.0
 * @description: 月份的标注
 * @date 10/23/18 21:30
 * @email redsstone@163.com
 */
public class MonthAxisValueFormatter implements IAxisValueFormatter{


    private String[] month;

    public MonthAxisValueFormatter(String[] month) {
        this.month = month;
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        int position = (int) value;
        return month[position - 1];
    }
}
